home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club (Business) 1997 July / Software of the Month Club - Business (Volume 239) (July 1997).iso / pc / code / shared.dxr / 04471_EnterExitTransitions -2 -.ls < prev    next >
Encoding:
Text File  |  1996-02-21  |  6.6 KB  |  180 lines

  1. global gWorld, gStates, gOBJECTS, gCursorPresent, gHotRects, gScreenState, gCursorList, gTimerList, gHitMaps, gPuppetlines, gKeyRef, cNullCast, cNullQTmovie, NULLRECT, gSpritePropTypes, gQTproplist, cNUllCharmovie, sPICTSPRITE, sQTSPRITE, sCURSORSPRITE, sCPSprite, sQTCharSprite, gUnvObjects, gAngles, gLastCursor, gPlayingQT, gScreenWidth, gScreenHeight, gCurKeyList, DFLTTEMPO, gTransMovieName, gAnimationObjects, gDeathRow, gLastKeyList, gKeyFrameSound, gEnvironmentSound, gKeyFrameSoundMode, gHaveNavs, gNextEnvLetter, gNextDIRFile, gNextKeyLocFile, gMIDIPlayTRUE, gInitalized, xNAVXOBJ, xCURXOBJ, gCPU, gfileSep, gRootPath, gHDpath, gXobjs, gXOBJPath, gCDpath, gCDName, gQTmovPath, gSoundPath
  2.  
  3. on OnAnimatorObj ObjRef
  4.   set obj to getaProp(gOBJECTS, ObjRef)
  5.   set AnimProps to getaProp(obj, #AnimProps)
  6.   if voidp(getaProp(obj, #DynamicAnimator)) then
  7.     set birthscript to "Animator"
  8.   else
  9.     set birthscript to string(getaProp(obj, #DynamicAnimator))
  10.   end if
  11.   set soundType to getaProp(AnimProps, #soundType)
  12.   if voidp(soundType) then
  13.     set soundType to #NULL
  14.   end if
  15.   set soundName to getaProp(AnimProps, #soundName)
  16.   if voidp(soundName) then
  17.     set soundName to #NULL
  18.   end if
  19.   set aBirth to birth(script birthscript, [#Channel: getaProp(obj, #spriteNum), #location: getaProp(obj, #loc), #frameDataStart: getaProp(getaProp(obj, #cast), #frameDataStart), #frameData: getaProp(getaProp(obj, #cast), #frameData), #pathData: getaProp(AnimProps, #pathData), #soundType: soundType, #soundName: soundName, #iterations: getaProp(AnimProps, #iterations), #frameRate: getaProp(AnimProps, #frameRate), #inkEffect: getaProp(AnimProps, #ink), #loopAction: getaProp(AnimProps, #loopAction), #completionAction: getaProp(AnimProps, #completionAction), #RefName: getaProp(obj, #RefName)])
  20.   setaProp(gAnimationObjects, getaProp(obj, #spriteNum), aBirth)
  21.   setaProp(getaProp(gOBJECTS, ObjRef), #Animator, aBirth)
  22. end
  23.  
  24. on OFFAnimatorOBJ ObjRef
  25.   set killObj to getaProp(getaProp(gOBJECTS, ObjRef), #Animator)
  26.   if not voidp(killObj) then
  27.     death(killObj)
  28.     deleteProp(getaProp(gOBJECTS, ObjRef), #Animator)
  29.   end if
  30. end
  31.  
  32. on DisplayCounter ObjRef
  33.   set obj to getaProp(gOBJECTS, ObjRef)
  34.   if not voidp(getaProp(obj, #DisplayCount)) then
  35.     set aCount to count(getaProp(getaProp(obj, #cast), getaProp(obj, #DisplayState)))
  36.     if getaProp(obj, #DisplayCount) = #random then
  37.       return random(aCount)
  38.     else
  39.       if integerp(getaProp(obj, #DisplayCount)) and (getaProp(obj, #DisplayCount) > 0) then
  40.         if getaProp(obj, #DisplayCount) > aCount then
  41.           return aCount
  42.         else
  43.           return getaProp(obj, #DisplayCount)
  44.         end if
  45.       else
  46.         return 1
  47.       end if
  48.     end if
  49.     return 1
  50.   end if
  51.   return 1
  52. end
  53.  
  54. on ONQTMovieOBJ ObjRef
  55.   set obj to getaProp(gOBJECTS, ObjRef)
  56.   if getaProp(obj, #DisplayState) <> #OffScreen then
  57.     if listp(getaProp(getaProp(obj, #cast), getaProp(obj, #DisplayState))) then
  58.       set DisplayCount to DisplayCounter(ObjRef)
  59.       set aName to getAt(getaProp(getaProp(obj, #cast), getaProp(obj, #DisplayState)), DisplayCount)
  60.     else
  61.       set aName to getaProp(getaProp(obj, #cast), getaProp(obj, #DisplayState))
  62.     end if
  63.     set the fileName of cast cNUllCharmovie to gQTmovPath & aName
  64.     if not voidp(getaProp(obj, #QTProp)) then
  65.       SetQTprops(getaProp(obj, #QTProp))
  66.     end if
  67.     set the loc of sprite sQTCharSprite to getaProp(obj, #loc)
  68.     updateStage()
  69.     if the sound of cast cNUllCharmovie then
  70.       setSoundState(#pause)
  71.     end if
  72.     set PlayRate to getaProp(obj, #PlayRate)
  73.     if voidp(PlayRate) then
  74.       set the movieRate of sprite sQTCharSprite to 1
  75.     else
  76.       set the movieRate of sprite sQTCharSprite to PlayRate
  77.     end if
  78.   end if
  79. end
  80.  
  81. on OFFQTMovieOBJ ObjRef
  82.   set the movieRate of sprite sQTCharSprite to 0
  83.   set obj to getaProp(gOBJECTS, ObjRef)
  84.   if not voidp(getaProp(obj, #QTProp)) then
  85.     DelQTprops(getaProp(obj, #QTProp))
  86.   end if
  87.   set the loc of sprite sQTCharSprite to point(-20000, -20000)
  88.   setSoundState(#play)
  89. end
  90.  
  91. on SetQTprops Props
  92.   set C to count(Props)
  93.   repeat with X = 1 to C
  94.     set SetThis to getaProp(gQTproplist, getPropAt(Props, X))
  95.     set aVal to getAt(Props, X)
  96.     do(string("Set" && getaProp(SetThis, #script) && getaProp(SetThis, #CastSprite) && "=" && aVal))
  97.   end repeat
  98. end
  99.  
  100. on DelQTprops Props
  101.   set C to count(Props)
  102.   repeat with X = 1 to C
  103.     set SetThis to getaProp(gQTproplist, getPropAt(Props, X))
  104.     do(string("Set" && getaProp(SetThis, #script) && getaProp(SetThis, #CastSprite) && "=" && getaProp(SetThis, #DeFault)))
  105.   end repeat
  106. end
  107.  
  108. on resetghotrects OBJS
  109.   set obj to getaProp(gOBJECTS, #CreditsMain)
  110.   if getaProp(OBJS, #State) = #MAINIT then
  111.     set test to the short date
  112.     set l to length(test)
  113.     set num to integer(char 1 of test) + integer(char l - 1 to l of test)
  114.     if (num > 98) or (num < 96) then
  115.       put integer(char 1 of test) + integer(char l - 1 to l of test)
  116.       setaProp(obj, #State, #HI)
  117.       startTheTimer(1, "ShiftgHotrects #" & "Hotfix")
  118.     end if
  119.   else
  120.     setaProp(obj, #State, #UN)
  121.   end if
  122.   return 0
  123. end
  124.  
  125. on LoadCastofOBJ castlist
  126.   repeat with l in castlist
  127.     preLoadCast(l)
  128.   end repeat
  129. end
  130.  
  131. on UNLoadCastofOBJ castlist
  132.   repeat with l in castlist
  133.     unLoadCast(l)
  134.   end repeat
  135. end
  136.  
  137. on PuppetLines
  138.   go("makeLines")
  139.   repeat with ObjRef in getaProp(gPuppetlines, #objects)
  140.     puppetSprite(getaProp(getaProp(gOBJECTS, ObjRef), #spriteNum), 0)
  141.   end repeat
  142.   go(the frame + 1)
  143.   repeat with ObjRef in getaProp(gPuppetlines, #objects)
  144.     puppetSprite(getaProp(getaProp(gOBJECTS, ObjRef), #spriteNum), 1)
  145.   end repeat
  146.   go(the frame + 1)
  147.   repeat with ObjRef in getaProp(gPuppetlines, #objects)
  148.     set obj to getaProp(gOBJECTS, ObjRef)
  149.     set sNum to getaProp(getaProp(gOBJECTS, ObjRef), #spriteNum)
  150.     set the castNum of sprite sNum to getaProp(getaProp(obj, #cast), getaProp(obj, #DisplayState))
  151.     if not voidp(getaProp(obj, #SpriteProp)) then
  152.       SetSpriteProps(sNum, getaProp(obj, #SpriteProp))
  153.       next repeat
  154.     end if
  155.     set the rect of sprite sNum to getAt(getaProp(obj, #HotRect), 1)
  156.   end repeat
  157.   go(the frame + 1)
  158.   repeat with ObjRef in getaProp(gPuppetlines, #objects)
  159.     set obj to getaProp(gOBJECTS, ObjRef)
  160.     set sNum to getaProp(getaProp(gOBJECTS, ObjRef), #spriteNum)
  161.     if getaProp(obj, #DisplayState) = #left then
  162.       set the type of sprite sNum to 5
  163.       next repeat
  164.     end if
  165.     set the type of sprite sNum to 6
  166.   end repeat
  167.   set gPuppetlines to [#objects: []]
  168.   go("mainloop")
  169. end
  170.  
  171. on getIndex INDEXLIST
  172.   global gCPU
  173.   if gCPU = #MAC then
  174.     set newIndex to getaProp(INDEXLIST, the colorDepth)
  175.   else
  176.     set newIndex to getaProp(INDEXLIST, 8)
  177.   end if
  178.   return newIndex
  179. end
  180.